﻿<!DOCTYPE html>
<html>
<head>
<title>后台管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<?=WEBURL ?>/editor/themes/default/default.css" />
<link rel="stylesheet" href="<?=WEBURL ?>/editor/plugins/code/prettify.css" />
<link href="<?=CSS?>font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="<?=CSS?>colorbox.css" rel="stylesheet" type="text/css" />
    <link href="<?=CSS?>base.css" rel="stylesheet" type="text/css" />
<link href="<?=CSS?>css.css" rel="stylesheet" type="text/css" />
<style>
	html,body{width:100%;height:100%;margin:0px;padding:0px;font-size:12px;overflow:hidden;}
    .wav{
        width: 14px;
        height: 12px;
        overflow: hidden;
        display: inline-block;
        background: url(<?=IMG?>voice.png) left center no-repeat;
        background-size: 14px 14px;
        cursor: pointer;
    }
    .wav-close{
        background: url(<?=IMG?>mute.png) left center no-repeat;
        background-size: 14px 14px;
    }
</style>
<script>
	var client_type = "<?=$this->client_type?>";
	var refreshTimeObj = null;
	var cashredio = rechargeredio = 1;
</script>
</head>
    <body class="mainbody" id="dom_body">
		<!--顶部-->
        <div id="top" class="w">
			<div class="hd">
				<div class="top">
					<span><a href="javascript:;" class="mainFrame"  action="/home/desktop">桌面<em id="online"></em> </a>&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="javascript:;" class="mainFrame"  action="/members/cashlog">提现<em id="cash">[0]</em></a>&nbsp;<a href="javascript:;" class="wav cashRadio"></a>&nbsp;
					<a href="javascript:;" class="mainFrame"  action="/members/rechargelog">充值<em id="recharge">[0]</em></a>&nbsp;<a href="javascript:;" class="wav rechargeRadio"></a>&nbsp;
                        <a href="javascript:;" class="mainFrame" action="/members/betslog">发包记录</a>
                        <a href="javascript:;" class="mainFrame" action="/members/coinlog">帐变</a>
                        <a href="javascript:;" class="mainFrame" action="/members/members_list">用户</a>
                        <a href="javascript:;" class="mainFrame" action="/members/agentuser_list">代理</a>
                    </span><i class="icon-angle-double-left"></i>&nbsp;&nbsp;当前登录：<?php echo $this->user['username'];?>&nbsp;&nbsp;
					<a href='javascript:;' class="mainFrame" action='/sys/modifyloginpass'>[修改密码]</a>&nbsp;&nbsp;
					<a href="javascript:;"  class="mainFrame" action="/sys/logout">[退出登录]</a>
                    &nbsp;&nbsp;<a href="javascript:;" class="" id="timespan"><?php echo date('Y-m-d H:i:s') ?></a>
                </div>
				<div class="mu">
					<div class="logo"><img src="<?=IMG?>logo.gif" height="35" /></div>
					<div id="menuinfo" class="menu">
                        <a href="javascript:;"  action="/home/leftmenu?menu=coin">资金</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=redpacket">红包游戏</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=rooms">聊天室</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=users">用户</a>
                        <a href="javascript:;"  action="/home/leftmenu?menu=exchange">兑换</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=news">资讯文章</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=box">短信</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=ads">广告</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=count">统计</a>
						<a href="javascript:;"  action="/home/leftmenu?menu=sys">系统</a>
					</div>
				</div>
			</div>
			<div style="dispaly:none;" id="wavplay"><audio id="cashmp3" src="<?=SOUND?>/cash.mp3"></div>
			<div style="dispaly:none;" id="wavplay1"><audio id="rechargemp3" src="<?=SOUND?>/recharge.mp3"></div>
			<div style="dispaly:none;" id="wavplay2"></div>
			<div style="dispaly:none;" id="wavplay3"></div>		
		</div>
		<div id="main-body" class="w">
			<!--菜单-->
			<div id="leftmenu"></div>
			<!--框架内容-->
			<div id="iframe"></div>
		</div>
		<!--尾部-->
		<div id="bottom" class="clearfix"></div>
		<div id="loading-page" class="dialogue"><div class="dialogue-warp"></div></div>
		<div id="dialogue" class="dialogue">
			<div class="dialogue-warp">
				<div class="dialogue-head">
					<span class="dialogue-title icon-lamp">系统提示</span>
				</div>
				<div class="dialogue-body"></div>
				<div class="dialogue-foot">
					<div class="dialogue-auto">
						<span class="dialogue-sec"></span>秒后自动关闭
					</div>
					<div class="right">
						<button class="dialogue-yes btn btn-blue icon-ok"></button>
						<button class="dialogue-no btn btn-white icon-undo"></button>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="<?=SCRIPT?>jquery.min.js"></script>
        <script type="text/javascript" src="<?=SCRIPT?>jquery.citys.js"></script>
        <script type="text/javascript" src="<?=SCRIPT?>datepicker/wdatepicker.js"></script>
		<script charset="utf-8" src="<?=WEBURL ?>/editor/kindeditor.js"></script>
		<script charset="utf-8" src="<?=WEBURL ?>/editor/lang/zh_CN.js"></script>
		<script charset="utf-8" src="<?=WEBURL ?>/editor/plugins/code/prettify.js"></script>
        <script type="text/javascript" src="<?=SCRIPT?>jquery.colorbox.js"></script>
		<script type="text/javascript" src="<?=SCRIPT?>command.js"></script>
        <script type="text/javascript" src="<?=SCRIPT?>function.js"></script>
		<script src="<?=SCRIPT?>socket.io.js" type="text/javascript" charset="utf-8"></script>
		<script>
			$(document).ready(function() {
                //设计高度
                $(window).resize(function () {
                    var _h = $(window).height() - 63;
                    var _w = $(window).width() - 150;
                    var _maintop_h = $("#iframe .maintop").outerHeight() || 33;
                    var _search_h = $("#iframe .main-search").outerHeight() || 8;
                    var _mainbody_h = parseInt(_h) - parseInt(_maintop_h) - parseInt(_search_h);
                    $("#main-body").height(_h);
                    $("#iframe").width(_w);
                    $("#iframe").height(_h);
                    $("#mainbody").height(_mainbody_h);
                });
                //默认加载资金流水菜单
                JumpFrame("/home/leftmenu?menu=sys");
                //默认桌面
                JumpMainFrame("/home/desktop");
                $("a.mainFrame").live({
                    click: function () {
                        var _action = $(this).attr("action");
                        if (typeof _action === 'undefined' || _action === '') return false;
                        $('.mainFrame').removeClass('active');
                        $(this).addClass('active');
                        JumpMainFrame(_action);
                    },
                    mouseover: function () {
                        var _action = $(this).attr("action");
                        if (typeof _action === 'undefined' || _action === '') return false;
                        $("#bottom").html(_action);
                    },
                });
                $("#menuinfo a").live({
                    click: function () {
                        var _action = $(this).attr("action");
                        if (typeof _action === 'undefined' || _action === '') return false;
                        JumpFrame(_action);
                    },
                    mouseover: function () {
                        var _action = $(this).attr("action");
                        if (typeof _action === 'undefined' || _action === '') return false;
                        $("#bottom").html(_action);
                    },
                }),
                    $(".switchs li").live("click", function () {
                        $(".switchs li").addClass("c");
                        $(this).removeClass("c");
                        $(".info div").css("display", "none");
                        $("#info" + $(this).attr("id")).css("display", "block");
                        $("#info" + $(this).attr("id") + " div").css("display", "block");
                        $("#info" + $(this).attr("id") + " div.hiddencontentdiv").css("display", "none");
                        $(".info div.btndiv").css("display", "block");
                    });
                //列表全选
                $("#selectAllid").live("click", function () {
                    if (this.checked) {
                        $(".tablist input[name=selectValue]").attr("checked", true);
                    } else {
                        $(".tablist input[name=selectValue]").attr("checked", false);
                    }
                });
                //删除选择
                $("#deleteSelectId").live("click", function () {
                    var _action = $(this).attr('action');
                    var _selectId = "";
                    var arrChk = $(".tablist input[name=selectValue]:checked");
                    $(arrChk).each(function () {
                        _selectId += ',' + this.value;
                    });
                    _selectId = _selectId.substr(1, _selectId.length - 1);
                    if (_selectId.length <= 0) {
                        $.error("没有选择要删除的数据行");
                        return false;
                    }
                    ajaxpostdata(_action, {ids: _selectId});
                });
                //选择预设的提现错误信息
                $("select[name=errorinfoselect]").live('change', function () {
                    $("input[name=info]").val($(this).val());
                });

                $(window).resize();

                // 加载在线人数
                setInterval(function () {

                }, 1000);

                function toNum(num)   //以为当是个位数时，要显示01的状态
                {
                    if (num < 10) {
                        return '0' + num;
                    }
                    else {
                        return "" + num;
                    }

                }

                //window.onload=function()
                //{

                var obj = document.getElementById("timespan");

                function tick() {
                    var objtime = obj.innerText;
                    var timestamp = (new Date("" + objtime + "")).valueOf() + 1000;
                    var nowtime = new Date(timestamp);
                    var time1 = nowtime.getFullYear() + "-" + (nowtime.getMonth() + 1) + "-" + nowtime.getDate() + " " + toNum(nowtime.getHours()) + ":" + toNum(nowtime.getMinutes()) + ":" + toNum(nowtime.getSeconds()); //获取小时分钟秒的一个字符串
                    obj.innerText = time1;
                }

                window.setInterval(tick, 1000);
                tick();  //为了一开始不显示000000

                $(".cashRadio").on("click",function () {
                    if(cashredio == 1){
                        cashredio = 0;
                        $(this).addClass("wav-close");
                    }else{
                        cashredio = 1;
                        $(this).removeClass("wav-close");
                    }
                });
                $(".rechargeRadio").on("click",function () {
                    if(rechargeredio == 1){
                        rechargeredio = 0;
                        $(this).addClass("wav-close");
                    }else{
                        rechargeredio = 1;
                        $(this).removeClass("wav-close");
                    }
                });
                function tip() {
                    $.ajax({
                        url:'/home/tip',
                        success : function(str){
                            var data = eval('('+str+')');
                            $('#recharge').text('【'+data.recharge+'】');
                            $('#cash').text('【'+data.cash+'】');
                            $('#online').text('【'+data.online+'】');
                            if(parseInt(data.cash)>0 && cashredio == 1){
                                document.getElementById("cashmp3").play();
                            }
                            if(parseInt(data.recharge)>0 && rechargeredio == 1){
                                document.getElementById("rechargemp3").play();
                            }
                        }
                    })
                }

                window.setInterval(tip,5000);

                tip();
            });

		</script>
    </body>
</html>